{% extends "analyse/layout.html" %}
{% load builds_tag %}

{% block title %}ianalyse - Take a closer look at your project{% endblock %}

{% block extrahead %}
<script type="text/javascript" src="{{ MEDIA_URL }}/js/swfobject.js"></script>
<link href="{{ MEDIA_URL }}/css/show.css" media="screen" rel="stylesheet" type="text/css"/>

<script type="text/javascript">
    swfobject.embedSWF(
            "{{ MEDIA_URL }}/swf/open-flash-chart.swf", "successful_rate", "550", "500",
            "9.0.0", "expressInstall.swf",
    {"data-file":"/results/{% project_id builds %}/pass_rate_by_day.txt"}
            );

    swfobject.embedSWF(
            "{{ MEDIA_URL }}/swf/open-flash-chart.swf", "build_times", "550", "500",
            "9.0.0", "expressInstall.swf",
    {"data-file":"/results/{% project_id builds %}/build_time_over_time.txt"}
            );
    swfobject.embedSWF(
            "{{ MEDIA_URL }}/swf/open-flash-chart.swf", "per_build_time", "550", "500",
            "9.0.0", "expressInstall.swf",
    {"data-file":"/results/{% project_id builds %}/per_build_info.txt"}
            );
    swfobject.embedSWF(
            "{{ MEDIA_URL }}/swf/open-flash-chart.swf", "run_times_and_pass_count_by_day", "550", "500",
            "9.0.0", "expressInstall.swf",
    {"data-file":"/results/{% project_id builds %}/run_times_and_pass_count_by_day.txt"}
            );
    swfobject.embedSWF(
            "{{ MEDIA_URL }}/swf/open-flash-chart.swf", "build_breakers", "550", "500",
            "9.0.0", "expressInstall.swf",
    {"data-file":"/results/{% project_id builds %}/build_breakers.txt"}
            );

</script>
{% endblock %}
{% block content %}
<div class="site">
	<div id="repos">
		<div class="repo public" id="repo_details">
		    <div class="title">
		      	 <div class="path">
			        <span>
						{% project_id builds %}				
					</span>
					<span id="download_button">
						<a href="/results/{% project_id builds %}/{% project_id builds %}.csv"><img src="/media/css/img/csv.png" style="border-width:0"></img> Export as CSV</a>
					</a>
			      </div>
				</span>
			      <div class="meta">
				      <table>
						<tr>
							<td class="label" style="vertical-align: top;">Description:</td>
					        <td>
								<span>{% summary builds %}</span>
				            </td>
						</tr>
				        <tr>
				          <td class="label" style="vertical-align:top">Pass rate:</td>
				          <td>
				            <span>{% pass_rate builds %}</span>
				          </td>
				        </tr>
				        <tr>
				          <td class="label" style="vertical-align:top">Avg Duration:</td>
				          <td>
				            <span>{% avg_build_time builds %}</span>
				          </td>
				        </tr>
				        <tr>
				          <td class="label" style="vertical-align:top">Last Build:</td>
				          <td>
				            {% last_build_span builds%}
				          </td>
				        </tr>
				        <tr>
				          <td class="label" style="vertical-align:top">Last Pass:</td>
				          <td>
				            {% last_pass_span builds %}
				          </td>
				        </tr>
				      </table>
				  </div>
			 </div>
		</div>
	</div>
	<b id="build_breakers"></b>
	<input id="export_build_breakers" type="button" value="Export as Image" style="cursor:pointer"></input>
	{%export_as_img "#export_build_breakers" "#build_breakers" "{{project_id}}/build_breakers.png"%}	
	
	<b id="run_times_and_pass_count_by_day"></b>
	<input id="export_run_times_and_pass_count_by_day" type="button" value="Export as Image" style="cursor:pointer"></input>
	{%export_as_img "#export_run_times_and_pass_count_by_day" "#run_times_and_pass_count_by_day" "{{project_id}}/run_times_and_pass_count_by_day.png"%}
	
	<b id="successful_rate"></b>
	<input id="export_successful_rate" type="button" value="Export as Image" style="cursor:pointer"></input>
	{%export_as_img "#export_successful_rate" "#successful_rate" "{{project_id}}/successful_rate.png"%}
	
	<b id="build_times"></b>
	<input id="export_build_times" type="button" value="Export as Image" style="cursor:pointer"></input>
	{%export_as_img "#export_build_times" "#build_times" "{{project_id}}/build_times.png"%}
	
	<b id="per_build_time"></b>	
	<input id="export_per_build_time" type="button" value="Export as Image" style="cursor:pointer"></input>
	{%export_as_img "#export_per_build_time" "#per_build_time" "{{project_id}}/per_build_time.png"%}
	<div class="push"></div>
		
</div>
<div id="light_box"></div>


{% endblock %}